import 'package:flutter/material.dart';
import 'app.dart';
import 'package:flutter_localizations/flutter_localizations.dart';

APP app = APP.getInstance();
class BasicApp extends StatelessWidget {

  final String homeTitle;
  final Widget loginPage;
  final ThemeData theme;
  final Function route;

  BasicApp({this.homeTitle,this.loginPage,this.theme,this.route}) {
    // final router = new Router();
    // Routes.configureRoutes(router);
    // Application.router = router;
  }

  @override
  Widget build(BuildContext context) {
    // Store.value<ConfigModel>(context).$getTheme();
    // return Store.connect<ConfigModel>(builder: (context, child, model) {
      return MaterialApp(
        theme: theme,
        title: homeTitle,
        debugShowCheckedModeBanner: false,
        initialRoute: "/",
        home: loginPage,
        onGenerateRoute: route,
        // 2019-06-14增加本地化设置
        localizationsDelegates: [
          GlobalMaterialLocalizations.delegate,
          GlobalWidgetsLocalizations.delegate,
        ],
        supportedLocales: [
          const Locale('zh', 'CH'),
          const Locale('en', 'US'),
        ],
      );
    // });
  }
}